package train48days;

public class 跳台阶扩展问题 {
    public int jumpFloorII (int number) {
//        return 1<<(number-1);
        if (number ==1){
            return 1;
        }else if (number == 2){
            return 2;
        } else {
            int[] dp = new int[number+1];
            dp[0] = 1;
            dp[1] = 1;
            dp[2] = 2;
            for (int i = 3; i <=number; i++) {
                for (int j = 0; j <i; j++) {
                    dp[i]+=dp[j];
                }
            }
           return dp[number];
        }
    }
}
